<template>
  <div class="image-card">
    <el-card :body-style="{ padding: 0 }">
      <div class="image-wrapper">
        <img :src="props.imageUrl" class="image" />
      </div>
      <div class="info">
        <h3 class="title">{{ props.title }}</h3>
        <div class="user">
          <el-avatar :size="24" :src="props.userAvatar" />
          <span class="username">{{ props.username }}</span>
        </div>
      </div>
    </el-card>
  </div>
</template>

<script setup lang="ts">
const props = defineProps<{
  imageUrl: string
  title: string
  username: string
  userAvatar: string
}>()
</script>

<style scoped lang="scss">
.image-card {
  transition: transform 0.3s;

  &:hover {
    transform: translateY(-5px);
  }
}

.image-wrapper {
  position: relative;
  padding-top: 100%; // 1:1 aspect ratio
}

.image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.info {
  padding: 12px;

  .title {
    margin: 0 0 8px;
    font-size: 14px;
    line-height: 1.4;
  }

  .user {
    display: flex;
    align-items: center;
    gap: 8px;

    .username {
      font-size: 12px;
      color: #666;
    }
  }
}
</style> 